# Contributor: wener <wenermail@gmail.com>
# Maintainer: wener <wenermail@gmail.com>
pkgname=frp
pkgver=0.43.0
pkgrel=0
pkgdesc="A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet."
url="https://github.com/fatedier/frp"
arch="all"
license="Apache-2.0"
makedepends="go"
subpackages="$pkgname-openrc"
source="https://github.com/fatedier/frp/archive/v$pkgver/frp-$pkgver.tar.gz
	frpc.initd
	frpc.confd
	frps.initd
	frps.confd
	"

build() {
	make build
}

check() {
	make test
}

package() {
	install -Dm755 bin/frpc "$pkgdir"/usr/bin/frpc
	install -Dm755 bin/frps "$pkgdir"/usr/bin/frps

	install -Dm644 conf/frpc.ini "$pkgdir"/etc/frp/frpc.ini
	install -Dm644 conf/frps.ini "$pkgdir"/etc/frp/frps.ini

	install -m755 -D "$srcdir"/frpc.initd "$pkgdir"/etc/init.d/frpc
	install -m644 -D "$srcdir"/frpc.confd "$pkgdir"/etc/conf.d/frpc

	install -m755 -D "$srcdir"/frps.initd "$pkgdir"/etc/init.d/frps
	install -m644 -D "$srcdir"/frps.confd "$pkgdir"/etc/conf.d/frps
}

sha512sums="
e6ccbf98d9d8fb714f37784ca582684b9f27994cf3f74b7081043285394243a8e9114b65f0918b64207a99064422312d700d01adaed085175314ad0ae238eb8f  frp-0.43.0.tar.gz
63468c7a644764f7733c3626636ff60494c65314660afdbbf2db70ee02e75ab3c4ad27e683053d783464cf85d7c85eb15d35e0c7b846be3dba994918e1ae9498  frpc.initd
ec6298b39a3804deee2e97b879f00c65f6cc6891e969fec7f8440decbba75451e97b54a8f8325b36ea2e5cff9a5d43f2cbdd994dcff5df91e45e13269133d4de  frpc.confd
afd7c823050fb423a92d0e2ef4ffce489ccd8bf59d775d9b94d66cf5109a37f5aee251f65b44bc1da6fee5b3006dfe86ab5408df02037f635905cf0bdebd118c  frps.initd
ec6298b39a3804deee2e97b879f00c65f6cc6891e969fec7f8440decbba75451e97b54a8f8325b36ea2e5cff9a5d43f2cbdd994dcff5df91e45e13269133d4de  frps.confd
"
